<?php
declare (strict_types = 1);

namespace app\product\model;

/**
 * @mixin \think\Model
 */
class ProductSkuModel extends BaseModel
{
    protected $table = 'tp_product_skus';
    protected $append = ['create_time_str','update_time_str'];

    public function getCreateTimeStrAttr($value,$data)
    {
        if(empty($data['create_time'])) return 0;
        return date('Y-m-d H:i:s', $data['create_time']);
    }

    public function getUpdateTimeStrAttr($value,$data)
    {
        if(empty($data['update_time'])) return 0;
        return date('Y-m-d H:i:s', $data['update_time']);
    }
}
